package com.ifp.opengate.boot.utils;

import java.time.ZonedDateTime;

import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

;

@Component
@ConfigurationPropertiesBinding
public class LocalCon implements Converter<String, ZonedDateTime> {
    public static void main(String[] args) {
        System.out.println(ZonedDateTime.now());
        // 2019-04-1T17:42:47.789-07:00[Asia/Shanghai]
        // 2020-06-21T22:45:51.189+08:00[Asia/Shanghai]
        ZonedDateTime now = ZonedDateTime.parse("2020-06-21T22:45:51.189+08:00[Asia/Shanghai]");
        System.out.println(now);
    }

    @Override
    public ZonedDateTime convert(String var1) {
        if (var1 == null) {
            return null;
        }
        return ZonedDateTime.parse(var1);
    }
}
